package com.vspush.util;

import com.alibaba.fastjson.JSON;
import com.vspush.udp.model.LinkUser;

public class StringUtils {
	
	public static String deMsg(String msg){
		msg = msg.substring("-msg-".length());
		msg = Base164.decodeToString(msg);
		return msg;
	}
	
	public static String enlogin(String username,String password){
		String uu = enUser( username, password);
		return "-start-"+uu+"-";
	}
	
	public static String enUser(String username,String password){
		LinkUser lu = new LinkUser(); 
		lu.setUsername(username);
		lu.setPassword(password);
		String user = JSON.toJSONString(lu);
		user = Base164.encodeToString(user);
		return "u-"+user+"";
	}

}
